#ifndef LOD_OBJECT3DV_H
#define LOD_OBJECT3DV_H

#include <vector>
#include <iostream>

#include "vertex.h"
#include "material.h"
#include "triangle.h"

template <class vtype>
struct object3dv
{
   std::vector<vtype> vects;
   std::vector<material> mats;
   std::vector<triangle> tris;

   int vcount;
   int mcount;
   int tcount;

   object3dv(int vreserve=0, int treserve=0, int mreserve=0) : 
      vcount(0),mcount(0),tcount(0)
   {
      if(vreserve>0)
         vects.reserve(vreserve);
      if(treserve>0)
         tris.reserve(treserve);
      if(mreserve>0)
         mats.reserve(mreserve);
   }

   void clear() {
      vects.clear();
      mats.clear();
      tris.clear();
      vcount=0;
      mcount=0;
      tcount=0;
   }

   bool operator== (object3dv<vtype> const& ob) const
   {
      /*std::cout<<vects.size()<<' '<<ob.vects.size()<<std::endl;
      if(vects==ob.vects)
         std::cout<<"a\t";
      if(mats==ob.mats)
         std::cout<<"b\t";
      if(tris==ob.tris)
         std::cout<<"c\t";
      if(vcount==ob.vcount)
         std::cout<<"d\t";
      if(tcount==ob.tcount)
         std::cout<<"e\t";
      if(mcount==ob.mcount)
         std::cout<<"f\t";*/
      return (vects==ob.vects &&
              mats==ob.mats && 
              tris==ob.tris &&
              vcount==ob.vcount &&
              tcount==ob.tcount &&
              mcount==ob.mcount);
   }
};

#endif
